﻿using System.ComponentModel;
using System.Web.Mvc;
using System.Collections.Generic;
using System;
using System.Globalization;
using EcoTourEduca.BingYourMaps.Models;

namespace EcoTourEduca.BingYourMaps.ViewModels
{
    public class EditBingMapsAreaViewModel
	{
		#region BingMapsArea properties

		[DisplayName("Center latitude")]
		public String CenterLatitudeStr { get; set; }
		[DisplayName("Center longitude")]
		public String CenterLongitudeStr { get; set; }
        [DisplayName("Friendly name")]
        public string FriendlyName { get; set; }
        [DisplayName("Map width")]
		public int? MapWidth { get; set; }
        [DisplayName("Map height")]
		public int MapHeight { get; set; }
        [DisplayName("Map zoom")]
		public int MapZoom { get; set; }
		[DisplayName("Map type")]
		public string MapType { get; set; }

        //?
		public IList<String> Titles { get; set; }

        // Collection of BingMapsLocation attached to the BingMapsArea
		public IEnumerable<BingMapsLocationPart> BingMapsLocations { get; set; }

		public float CenterLatitude
		{
			get
			{
				return Convert.ToSingle(CenterLatitudeStr, CultureInfo.InvariantCulture.NumberFormat);
			}
		}

		public float CenterLongitude
		{
			get
			{
				return Convert.ToSingle(CenterLongitudeStr, CultureInfo.InvariantCulture.NumberFormat);
			}
		}

		#endregion

        /// <summary>
        /// Default Bing Maps height.
        /// </summary>
        public const int DefaultMapHeight = 300;

		/// <summary>
		/// The types of map available.
		/// </summary>
		public SelectList MapTypeList { get; set; }

        /// <summary>
        /// Folder for the BingMaps pin icons.
        /// </summary>
		public String PinIconsFolder { get; set; }
	}
}